<include file="Public/head"/>
<link href="__PUBLIC__/layui/css/layui.css" rel="stylesheet" type="text/css" />
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
<style>
th{
    font-size:19px;
    color:#000;
}
#dao select{
    text-align: center;
}

table{
    height:700px;
    margin-top: 20px;
}
table td{
   font-size:16px;
}
#dao input{
    width:18px;
    height:18px;

    /*margin:0px 5px;*/ 
    /*padding: 0px 5px;*/
}

</style>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }

    </script>

    <include file="Public/sidebar"/>
   <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>
                    <div class="row">
                    <div class="col-xs-12">
                        <!-- <form action="" style="margin-top:2%;"> -->
                        <table class="table table-bordered" >
                            <thead>
                                <tr>
                                    <th colspan="9" class="center warning" style="color:#000;font-size:30px;"> 绩效考核表</th>
                                </tr>
                                <tr>
                                    <th class="center danger">角度</th>
                                    <th class="center danger">战略目标</th>
                                    <th class="center danger">衡量指标</th>
                                    <th class="center danger">权重</th>
                                    <th class="center danger">目标值</th>
                                    <th class="center danger">计分规则</th>
                                    <th class="center danger">数据来源</th>
                                    <?php if($gwei == 0): ?>
                                        <th class="center danger">考核部门</th>
                                    <?php else: ?>
                                        <th class="center danger">考核岗位</th>
                                    <?php endif ?>
                                    
                                    <th class="center danger">评分人</th>
                                </tr>
                            </thead>
                            <tbody>
                                <volist name="jlist" id="v">
                                <tr>
                                    <!-- <td class="center success">{$v.id}</td> -->
                                    <td class="center success">{$v.angle}</td>
                                    <td class="center">{$v.target}</td>
                                    <td class="center">{$v.norm}</td>
                                    <td class="center">{$v.weight}%</td>
                                    <td class="center">
                                        <?php if(is_numeric($v['value'])): ?>
                                            {$v.value}%
                                        <?php else: ?>
                                            {$v.value}
                                        <?php endif ?>
                                    </td>
                                    <td class="center" style="width:25%;">{$v.rule}</td>
                                    <td class="center">{$v.num}</td>
                                    <?php if($gwei == 0): ?>
                                        <td class="center">{$v.bu}</td>
                                    <?php else: ?>
                                        <td class="center">{$v.gwei}</td>
                                    <?php endif ?>
                                    
                                    <td class="center" style="display:none;">{$v.yue}</td>
                                    <td class="center"><button onclick="dui({$v.id},this)" class="btn-primary">选择评分人</button></td>
                                </tr>  
                                </volist>
                                <tr>
                                    <td colspan="9" class="center"><button class="btn-info" style="width:100px;height:30px;font-size:17px;">提交</button></td>
                                </tr>
                            </tbody>
                        </table>
                        <!-- </form> -->
 
                    </div>
                    </div>

                    <div id="dao" style="display:none;">
                            <div class="checkbox" style="margin-left:20px;">
                                <form action="" id="xform">
                                    <input type="hidden" name="pid" id="id">
                                    <input type="hidden" name="angle" id="angle">
                                    <input type="hidden" name="target" id="target">
                                    <input type="hidden" name="norm" id="norm">
                                    <input type="hidden" name="weight" id="weight">
                                    <input type="hidden" name="value" id="value">
                                    <input type="hidden" name="rule" id="rule">
                                    <input type="hidden" name="num" id="num">
                                    <input type="hidden" name="ment" id="ment">
                                    <input type="hidden" name="yue" id="yue">
                                     <volist name="mlist" id="m">
                                        <label>
                                            <input type="checkbox"  name="user[]" value="{$m.user}"><b>{$m.user}</b>
                                        </label>&nbsp&nbsp&nbsp
                                     </volist>
                                     
                                </form>
                                <div style="margin-top:40%;margin-left:45%;background-color:#66B3FF;width:70px;text-align:center;height:30px;line-height:30px;border:1px solid #66B3FF;box-shadow: 3px 3px 10px #ADADAD;color:#fff;cursor:pointer;font-size:16px;" onclick="xuan()">确定</div>
                            </div>


                    </div>
                    
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script src="__PUBLIC__/qwadmin/js/function.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
function dui(id,obj)
{
    // console.log(obj);
    // console.log(id);
    var yue = $(obj).parent().prev().text();
    var ment = $(obj).parent().prev().prev().text();
    var num = $(obj).parent().prev().prev().prev().text();
    var rule = $(obj).parent().prev().prev().prev().prev().text();
    var value = $(obj).parent().prev().prev().prev().prev().prev().text();
    var weight = $(obj).parent().prev().prev().prev().prev().prev().prev().text();
    var norm = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().text();
    var target = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var angle = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    // var id = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    // console.log(angle);
    $('#angle').val(angle);
    $('#target').val(target);
    $('#norm').val(norm);
    $('#weight').val(weight);
    $('#value').val(value);
    $('#rule').val(rule);
    $('#num').val(num);
    $('#ment').val(ment);
    $('#yue').val(yue);
    $('#id').val(id);
    // console.log($('#angle').val());
    layer.open({
        type: 1,
        title:  ['对应人选择', 'font-size:17px;'],
        skin: 'demo-class', //加上边框
        area: ['700px', '400px'], //宽高
        content: $('#dao'),
        // btn:'按钮'
    });
}



function xuan()
{
    //询问框
    layer.confirm('确定选择么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
             type: "POST",
             url:"{:U('xuan')}",
             data:$('#xform').serialize(),// 要提交的表单 
             beforeSend:function(){
                   layer.load(0, {shade: false});
                },
             success: function(msg) {
                // console.log(msg);
                if (msg == 1111) {
                    layer.msg('添加成功~', {icon: 1});
                    history.go(0); 
                }else{
                    layer.msg('添加失败！', {icon: 2});
                }
             },
             complete: function() {
                     layer.closeAll('loading');
                }
         });
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });   
            
}
</script>
</body>
</html>



